<template>
  <!-- 包装 -->
    <div class="swiper" :class="name">
      <div class="swiper-wrapper">
          <slot></slot>
      </div>
    </div>
  </template>
<script>
import Swiper from 'swiper/bundle' // 导入所有模块
import 'swiper/swiper-bundle.css'
export default {
  props: {
    number: {
      type: Number,
      default: 1
    },
    name: {
      type: String
    }
  },
  mounted () {
    new Swiper('.' + this.name, {
      slidesPerView: this.number,
      spaceBetween: 20,
      pagination: {
        clickable: true
      }
    })
  }
}

</script>
  <style>
  :root{
    --swiper-theme-color:white;
  }
  </style>
